<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}" media="all"/>
    <!-- 引入jquery -->
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script type="text/javascript" th:src="@{/js/bootstrap.js}"></script>



    <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="../showstatic/js/layer-v3.0.3/layer/mobile/need/layer.css" rel="stylesheet" type="text/css" />
    <link href="../showstatic/css/login.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../showstatic/js/phone.js" ></script>
    <script type="text/javascript" src="../showstatic/js/layer-v3.0.3/layer/mobile/layer.js"></script>

    <title></title>
</head>
<body style="">

<header class="header">
    <a href="javascript:history.back(-1)" class="fa fa-angle-left"></a>
    <span class="names">用户反馈</span>
</header>

<!--background-image: url(../image/e.jpeg);-->
<div  id="a" class="container" style="width:80%;height:100%;">
    <div class="modal-header">
        <!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> -->
        <h4 class="modal-title" id="exampleModalLabel" style="font-size: 20px;">信息反馈</h4>
    </div>
    <div class="modal-body">

        <form>
            <div class="form-group">
                <!--for="message-text"-->
                <label  class="control-label" style="font-size: 18px;">反馈信息描述:</label>
                <span id="error1" style="color: #ff2320"></span>
                <textarea class="form-control" id="m1" rows="3" onblur="check()"></textarea>
            </div>
            <div class="form-group">
                <!-- <label for="message-text" class="control-label" style="font-size: 18px;">相关图片描述</label>
                <input type="file" value="选择图片">
                <textarea class="form-control" id="recipient-name" rows="4"></textarea> -->
                <label  class="control-label" style="font-size: 18px;">建议:</label>
                <span id="error2"></span>
                <textarea class="form-control" id="m2" rows="3"></textarea>
            </div>
            <br>
            <br>
            <br>
            <p>感谢对本影院的支持，我们会尽快处理您的问题以及建议，谢谢!</p>
            <br>
            <br>
            <div class="form-group" style="position: relative;left: 450px;">
                <!-- <button type="button" class="btn btn-default">退出</button> -->
                <button type="button" class="btn btn-primary btn-lg" onclick="insert()">确认</button>
            </div>
        </form>
    </div>

</div>
<script th:src="@{/layui/layui.js}" charset="utf-8"></script>
<script th:inline="javascript">
    var url=[[@{/}]]
</script>
<script th:inline="none">
    var param1 = false;

    function check() {
        $("#error1").html("");
        var a = $("#m1").val();
        if(a == '' | a == null){
            $("#error1").append("不能为空")
        }else{
            param1 = true;
        }
    }
    //var layer = layui.layer;
    function insert() {
        if(param1){
            $.ajax({
                url:url+'problem/addProblem',
                type:'post',
                data:{'problemInfo':$("#m1").val(),'problemImg':$("#m2").val()},
                success:function (data) {
                    //layer.msg(data);

                    //console.log('1111')
                    if(data == '未登录'){
                        location.href="/movieshow/login.html";
                    }else{
                        location.href="/movieshow/index.html";
                    }


                }
            })
        }
    }
</script>
</body>
</html>
